<template>
	<view class="page">
		<!-- <z-paging ref="paging" v-model="dataList" @query="queryList"> -->
			<view slot="top">
				<!-- <u-navbar :isBack="true" title="九度人际" title-color="#101010" 
				:background="{background: 'none'}" :borderBottom="false"></u-navbar> -->
				<view class="no-yy" style="color: #111111;font-size: 36rpx;font-weight: bold;width: 340rpx;
				margin-top: 100rpx;margin-left: 32rpx;">九度人际</view>
				<view style="width: 100%;padding: 50rpx 32rpx 30rpx 32rpx;">
					<u-line-progress :striped="true" :percent="progress_tack" :striped-active="true"
					active-color="#19be6b"></u-line-progress>
					<view style="margin-top: 20rpx;">
						<u-tabs :list="tabsList" :is-scroll="false" :current="tabsIndex" @change="tabsChange"
							bg-color="none"></u-tabs>
					</view>
				</view>
			</view>
			
			<view style="padding: 0rpx 32rpx 0 32rpx;">
				<view style="padding: 0rpx 24rpx;background: #fff;border-radius: 24rpx;">
					
					<view v-if="tabsIndex == 0">
						<view v-if="progress_tack > 99" style="padding: 60px;font-size: 26px;text-align: center;">
							<view>恭喜您</view>
							<view style="margin-top: 20rpx;">个人任务已经完成</view>
						</view>
						<view v-else>
							<view style="padding: 32rpx 0;display: flex;align-items: center;border-bottom: 2rpx #F5F5F5 solid;"
							v-for="(item, index) in dataList" :key="index">
								<!-- <image src="@/static/my/notop.png" mode="aspectFill" style="width: 96rpx;height: 96rpx;"></image> -->
								<view style="flex: 1;margin-left: 24rpx;font-size: 28rpx;">
									<view style="display: flex;justify-content: space-between;">
										<view style="color: #111111;font-weight: bold;">{{ item.name }}</view>
										<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 2" 
										@click="jumpTo('/pages/my/taskSubmit?tid=' + item.user_id)">
											<text style="font-size: 20rpx;color: #257CF6;background: #e5effe;
											padding: 4rpx 12rpx;border-radius: 8rpx;">提交任务</text>
										</view>
										<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 1">
											<text style="font-size: 20rpx;color: #19be6b;background: #dbf1e1;
											padding: 4rpx 12rpx;border-radius: 8rpx;">已完成</text>
										</view>
										<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 3">
											<text style="font-size: 20rpx;color: #ff9900;background: #fdf6ec;
											padding: 4rpx 12rpx;border-radius: 8rpx;">待审核</text>
										</view>
										<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 4">
											<text style="font-size: 20rpx;color: #ff9900;background: #fdf6ec;
											padding: 4rpx 12rpx;border-radius: 8rpx;">未完成</text>
										</view>
									</view>
									<view style="display: flex;justify-content: space-between;margin-top: 16rpx;">
										<view style="color: #999CA3;">视频号：{{ item.shipinhao }}</view>
									</view>
								</view>
							</view>
						</view>
					</view>
					<view v-else>
						<view style="padding: 32rpx 0;display: flex;align-items: center;border-bottom: 2rpx #F5F5F5 solid;"
						v-for="(item, index) in dataList" :key="index">
							<!-- <image src="@/static/my/notop.png" mode="aspectFill" style="width: 96rpx;height: 96rpx;"></image> -->
							<view style="flex: 1;margin-left: 24rpx;font-size: 28rpx;">
								<view style="display: flex;justify-content: space-between;">
									<view style="color: #111111;font-weight: bold;">{{ item.name }}</view>
									<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 2" 
									@click="jumpTo('/pages/my/taskSubmit?tid=' + item.user_id)">
										<text style="font-size: 20rpx;color: #257CF6;background: #e5effe;
										padding: 4rpx 12rpx;border-radius: 8rpx;">提交任务</text>
									</view>
									<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 1">
										<text style="font-size: 20rpx;color: #19be6b;background: #dbf1e1;
										padding: 4rpx 12rpx;border-radius: 8rpx;">已完成</text>
									</view>
									<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 3">
										<text style="font-size: 20rpx;color: #ff9900;background: #fdf6ec;
										padding: 4rpx 12rpx;border-radius: 8rpx;">待审核</text>
									</view>
									<view style="font-size: 24rpx;color: #CCCED1;" v-if="item.is_voucher == 4">
										<text style="font-size: 20rpx;color: #ff9900;background: #fdf6ec;
										padding: 4rpx 12rpx;border-radius: 8rpx;">未完成</text>
									</view>
								</view>
								<view style="display: flex;justify-content: space-between;margin-top: 16rpx;">
									<view style="color: #999CA3;">视频号：{{ item.shipinhao }}</view>
								</view>
							</view>
						</view>
					</view>
					
				</view>
			</view>
		
			<view style="height: 120rpx;"></view>
		
		<!-- </z-paging> -->
		
		<!-- <u-toast ref="uToast" /> -->
		<!-- <u-tabbar v-model="current" :list="tabbar" active-color="#50A5F4"></u-tabbar> -->
	</view>
</template>

<script>
	import {
		getTabbarConfig
	} from '@/common/tabbar';
	import appurl_config from 'utils/config.js';
	import {
		request
	} from 'utils/request.js';
	export default {
		data() {
			return {
				tabsList: [{
					name: '个人任务'
				}, {
					name: '邀请任务'
				}],
				tabsIndex: 0,
				
				current: 0,
				tabbar: getTabbarConfig(true),
				
				dataList: [],
				progress_tack: 0
				
			}
		},
		onLoad() {
			uni.hideShareMenu();
			this.dataLists();
		},
		methods: {
			// 获取商品列表
			dataLists() {
				
				let params = {};
				request.postWithToken({
					url: '/userget/userPidList',
					data: params
				}).then(res=>{
					// console.log(res)
					this.dataList = res.data.ancestorsData;
					// this.$refs.paging.complete(res.data.ancestorsData);
					// this.progress_tack = res.data.progress_tack;
				})
			},
			tabsChange(index) {
				this.tabsIndex = index;
				this.$refs.paging.reload();
			},
			jumpTo(path) {
				console.log(path)
				uni.navigateTo({
					url: path
				})
			},
			// 搜索
			onSearch(){
				this.$refs.uWaterfall.clear();
				this.$refs.paging.reload();
			},
			toDetail(item){
				Vue.prototype.MeetInfo = item
				uni.navigateTo({
					url:'detail'
				})
			},

		}
	}
</script>

<style>
	page{
		background-color: #F5F8FF !important;
	}
</style>
<style lang="scss" scoped>
	
</style>
